﻿using FastExecutor.Base.Design;
using FastExecutor.ORG.Entity;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace FastExecutor.ORG.Controller
{
    [RouteArea("Frame")]
    [RoutePrefix("Task")]
    public class TaskController : FastTemplateController<Frame_Task>
    {
        [Route("List")]
        public ActionResult List()
        {
            return View("~/Views/Frame/Task/Task_List.cshtml");
        }
        [Route("Add")]
        public ActionResult Add()
        {
            return View("~/Views/Frame/Task/Task_Add.cshtml");
        }
        [Route("Edit")]
        public ActionResult Edit()
        {
            return View("~/Views/Frame/Task/Task_Edit.cshtml");
        }

        [HttpPost, Route("FindList")]
        public override ActionResult FindList()
        {
            JObject Params = GetParams();
            string TaskName = Convert.ToString(Params["TaskName"]);
            if (!string.IsNullOrEmpty(TaskName))
            {
                ListWhereText += string.Format(" and TaskName like '%{0}%'", TaskName);
            }
            return base.FindList();
        }

        [HttpPost, Route("FindDetail")]
        public override ActionResult FindDetail()
        {
            return base.FindDetail();
        }

        [HttpPost, Route("OperateAdd")]
        public override ActionResult OperateAdd(Frame_Task Entity)
        {

            return base.OperateAdd(Entity);
        }

        [HttpPost, Route("OperateUpdate")]
        public override ActionResult OperateUpdate()
        {
            return base.OperateUpdate();
        }

        [HttpPost, Route("OperateBatchDelete")]
        public override ActionResult OperateBatchDelete()
        {
            return base.OperateBatchDelete();
        }
    }
}
